Install Modal image dependencies from pinned uv.lock exports#608
Closed
anth-volk wants to merge 2 commits into
Closed
Install Modal image dependencies from pinned uv.lock exports#608anth-volk wants to merge 2 commits into
anth-volk wants to merge 2 commits into
Conversation
logfire >=4.7 imports importlib_metadata unconditionally on Python 3.13 but stopped receiving it transitively, so the freshly rebuilt gateway and simulation images crash on import logfire. The gateway ASGI factory died at startup, hanging every request past Modal's HTTP window (303 redirects), which failed all beta integration tests and blocked the production deploy of the observability PR (#594). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Modal images resolved their packages fresh at image-build time from loose pip_install ranges, so image dependencies drifted from the tested uv.lock environment; issue #602 (logfire resolving to a release with an undeclared importlib_metadata dependency) is the failure mode. Define the image package sets as uv dependency groups resolved inside uv.lock, export them to checked-in pinned requirements files, and install the images from those. make update re-exports after relocking and a unit test fails CI when the exports drift from the lock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #607
Stacked on #603 — merge that first; this diff shrinks to its own commit afterwards.
Problem
Modal image
pip_installcalls used loose ranges (logfire>=3.0.0), so any image-layer cache miss re-resolved packages fresh against PyPI. Image dependency versions drifted from the testeduv.lockenvironment, and breakage surfaced only in post-merge beta integration tests — #602 (gateway crash-looping on logfire's undeclaredimportlib_metadatadependency) is the incident this enables.Change
modal-simulation-image,modal-gateway-image) in the simulation project'spyproject.toml, resolved inside the sameuv.lockas the project — so image versions match what tests run against (e.g. images now get the testedlogfire==4.6.0, not whatever is newest).requirements/modal-*.txt, full transitive closure) viascripts/export-modal-image-requirements.sh; images install withpip_install_from_requirements.make updatere-exports after relocking, so the daily dependency-update workflow keeps images in lockstep with the lock.uv.lock, when any requirement is unpinned, or if the exports ever stop pinninglogfire/importlib-metadata(Beta gateway crash-loops: logfire import fails with ModuleNotFoundError (importlib_metadata) in rebuilt Modal images #602 regression guard).Tests
uv run pytest tests/: 331 passed (6 new)make format: cleanStaging image layers for the new chain will be prewarmed off the deploy path before merge.
🤖 Generated with Claude Code